// components/user/user.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },
  attached(){
    let user = wx.getStorageSync('user');
    this.setData({
      user:user
    })
  },
  /**
   * 组件的初始数据
   */
  data: {
    userName:{img:'../../icon/img/123.png',name:'无色',level:'LV7'},
    mode:true,
    user:null,
  },

  /**
   * 组件的方法列表
   */
  methods: {
    changeMode(){
      let flag = this.data.mode;
      this.setData({
        mode:!flag
      })
    },
    logout(){
      wx.removeStorageSync('user');
      wx.redirectTo({
        url: '../login/login'
      });
    }
  }
})
